﻿$NL.defined("NengLong.MicroLive.Module.User.Login.Model", ["js/core/nenglong.mvc.js"], function () {
    $NL.cls(NengLong.Mvc.Model, function () {
        this.cmd = {
            "login":"UserLogin"
        }
        this.login = function (params, callback) {
            if (params == null) params = {};
            var defParams={"m":"user","a":"login","d":params};
            this.request(defParams, callback);
        }

        this.getRememberLoginInfo = function() {
            //var resObj = window.localStorage.getItem("rememberLoginInfo");
            var resObj = NengLong.Util.Cookie.getCookie("rememberLoginInfo");
            if (!resObj) {
                return null;
            }
            resObj = JSON.parse(resObj);
            return resObj;
        }
        this.setRememberLoginInfo = function (loginInfo) {
            if (!loginInfo) {
                NengLong.Util.Cookie.delCookie("rememberLoginInfo");
            } else {
                NengLong.Util.Cookie.setCookie("rememberLoginInfo", JSON.stringify(loginInfo));
            }
        }
        this.setSessionId=function(sid){
            NengLong.Util.Cookie.setCookie("jxpt_sessionid",sid);
        }
        
    });
});

